/*
 * Created by JFormDesigner on Mon Apr 26 18:51:54 CST 2021
 */

package com.lgz.dbcourse.gui;

import java.awt.*;
import javax.swing.*;

/**
 * @author Brainrain
 */
public class Error extends JDialog {
    public Error(Window owner) {
        super(owner);
        initComponents();
    }

    public Error(Window owner, String msg) {
        super(owner);
        initComponents();
        this.setModal(true);
        this.label1.setText(msg);
    }

    public void start() {
        this.setVisible(true);
    }

    private void initComponents() {
        // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
        panel1 = new JPanel();
        panel2 = new JPanel();
        panel3 = new JPanel();
        panel4 = new JPanel();
        label1 = new JLabel();

        //======== this ========
        setTitle("Error");
        setMinimumSize(new Dimension(320, 120));
        Container contentPane = getContentPane();
        contentPane.setLayout(new BorderLayout());

        //======== panel1 ========
        {
            panel1.setPreferredSize(new Dimension(30, 0));
            panel1.setLayout(new BorderLayout());
        }
        contentPane.add(panel1, BorderLayout.WEST);

        //======== panel2 ========
        {
            panel2.setPreferredSize(new Dimension(0, 60));
            panel2.setLayout(new BorderLayout());
        }
        contentPane.add(panel2, BorderLayout.NORTH);

        //======== panel3 ========
        {
            panel3.setPreferredSize(new Dimension(30, 0));
            panel3.setLayout(new BorderLayout());
        }
        contentPane.add(panel3, BorderLayout.EAST);

        //======== panel4 ========
        {
            panel4.setPreferredSize(new Dimension(0, 50));
            panel4.setLayout(new BorderLayout());
        }
        contentPane.add(panel4, BorderLayout.SOUTH);

        //---- label1 ----
        label1.setText("text");
        label1.setPreferredSize(new Dimension(220, 48));
        label1.setHorizontalAlignment(SwingConstants.CENTER);
        contentPane.add(label1, BorderLayout.CENTER);
        pack();
        setLocationRelativeTo(getOwner());
        // JFormDesigner - End of component initialization  //GEN-END:initComponents
    }

    // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables
    private JPanel panel1;
    private JPanel panel2;
    private JPanel panel3;
    private JPanel panel4;
    private JLabel label1;
    // JFormDesigner - End of variables declaration  //GEN-END:variables
}
